package com.hzit.net.util;

import redis.clients.jedis.Jedis;

public class RedisUtil {

    static Jedis jedis=null;
    static {
        jedis=new Jedis("192.168.1.166",6379);
        jedis.auth("123");
    }
    public static String get(String key){
        return jedis.get(key);
    }
    public static void set(String key,Object value){
        String set = jedis.set(key, value + "");
        System.out.println("set:"+set);
    }
    public static void set(String key,Object value,int expire){
        String set = jedis.set(key,value+"");
        Long expire1 = jedis.expire(key, expire);
    }
    private static void setExpire(String key,int expire){
        Long expire1 = jedis.expire(key, expire);
    }
}
